package com.takeoutsystem.service.impl;

import com.takeoutsystem.bean.AdminAccount;
import com.takeoutsystem.dao.AdminAccountMapper;
import com.takeoutsystem.service.AdminAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminAccountServiceImpl implements AdminAccountService {
    @Autowired
    AdminAccountMapper mapper;

    @Override
    public boolean checkLogin(AdminAccount account) {
        AdminAccount item=mapper.selectByAllInfo(account);
        return item!=null;
    }

    @Override
    public boolean changePassword(AdminAccount account) {
        int result=mapper.updatePasswordByUser(account);
        return result>0;
    }
}
